<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../../jquery-3.2.1.js"></script>

    <script>
        let p1 = new Promise((resolve, reject) => {
            $.ajax({
                method: 'get',
                url: 'http',
                success: (data) => {
                    resolve(data);
                },
                error: err => {
                    reject(err);
                }
            })
        })

        $('.btn').click(async () => {
            let result = await p1;
            console.log(result);

        })
    </script>
</body>

</html>